package com.aikon.wht.httpclient;

import java.io.IOException;

import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.HttpClientBuilder;

/**
 * @author haitao.wang
 *
 */
public class TestOfHttpClient {

	public static void main(String[] args) throws ClientProtocolException, IOException {

		HttpGet httpGet = new HttpGet("https://www.iwjw.com");
		HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
		// HttpHost httpHost = new HttpHost("127.0.0.1",8080);
		// httpClientBuilder.set
		HttpClient httpClient = httpClientBuilder.build();
		CommonResponseHandler crh = new CommonResponseHandler();
		String httpResponse = (String) httpClient.execute(httpGet, crh);
		System.out.println(httpResponse);

	}
}
